<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/17
 * Time: 18:34
 * 两种写的方式，都可以
 */
$rs = swoole_async_readfile(__DIR__ . '/1.txt', function ($filename, $filecontent) {
    echo "filename:" . $filename . PHP_EOL;
    echo "filecontent:" . $filecontent . PHP_EOL;
});

var_dump($rs);

$result = SWOOLE\Async::readfile(__DIR__ . '/1.txt', function ($filename, $filecontent) {
    echo "filename:" . $filename . PHP_EOL;
    echo "filecontent:" . $filecontent . PHP_EOL;
});

var_dump($result);

echo 'start' . PHP_EOL;